package com.cjkj.equipment.domain.dto;

import com.cjkj.common.constant.UserConstants;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import java.util.Date;

@Data
public class EquipmentHistoryDataRequest {

    /**
     * 设备编号
     */
    @NotBlank(message = "设备编号不能为空！")
    private String equipmentNo;

    /**
     * 设备类型
     */
    @NotBlank(message = "设备类型不能为空！")
    private String equipmentType;

    /**
     * 开始时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date startTime;

    /**
     * 手机号
     */
    @NotBlank(message = "手机号不能为空！")
    @Pattern(regexp = UserConstants.MOBILE_PHONE_NUMBER_PATTERN, message = "手机号格式有误！")
    private String phone;

    /**
     * 每页条数
     */
    @NotNull(message = "每页条数不能为空！")
    private Integer pageSize;

    /**
     * 页码
     */
    @NotNull(message = "页码不能为空！")
    private Integer pageNum;


}
